﻿<MCard Height="400">
    <MFooter Padless="_padless" @attributes="LocalAttrs">
        <MCard Flat Tile Width="@("100%")" Class="red lighten-1 text-center">
            <MCardText>
                @foreach (var icon in _icons)
                {
                    <MButton Class="mx-4" Icon>
                        <MIcon Size="24">
                            @icon
                        </MIcon>
                    </MButton>
                }
            </MCardText>

            <MDivider></MDivider>

            <MCardText Class="white--text">
                @DateTime.Now.Year - <strong>MASA Blazor</strong>
            </MCardText>
        </MCard>
    </MFooter>

    <MRow Align="AlignTypes.Center" Justify="JustifyTypes.Center" Class="ma-12">
        <MCol Cols="12" Md="8">
            <MSelect @bind-Value="_variant" Items="_items" Label="Variant" ItemText="x => x" ItemValue="x => x"></MSelect>

            <MCheckbox @bind-Value="_padless" HideDetails="true" Label="Padless"></MCheckbox>
        </MCol>
    </MRow>
</MCard>

@code
{
    private string[] _icons = new string[4] { "mdi-home", "mdi-email", "mdi-calendar", "mdi-delete" };
    private List<string> _items = new List<string> { "Default", "Absolute", "Fixed" };
    private bool _padless = false;
    private string _variant = "Default";

    private Dictionary<string, object> LocalAttrs
    {
        get
        {
            var dic = new Dictionary<string, object>();
            if (_variant == "Default")
            {
                dic.Add("Absolute", false);
                dic.Add("Fixed", false);
            }
            else if (_variant == "Absolute")
            {
                dic.Add("Default", false);
                dic.Add("Fixed", false);
            }
            else
            {
                dic.Add("Default", false);
                dic.Add("Absolute", false);
            }
            
            dic.Add(_variant, true);

            return dic;
        }
    }
}